<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('谷歌秘钥')" />
</head>
<body>
<div class="main-content">
	<form id="form-user-add" class="form-horizontal">
		<input type="hidden" id="userId" name="userId" th:value="${user.userId}">
		<input type="hidden" id="loginName" name="loginName" th:value="${user.loginName}">
		<h4 class="form-header h4">基本信息</h4>
		<div class="row">
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label is-required">商户号：</label>
					<div class="col-sm-4">
						<input name="userCode" class="form-control" type="text" disabled th:value="${user.userCode}" style="width: 80%">
					</div>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="form-group">
					<label class="col-sm-4 control-label is-required">谷歌密钥：</label>
					<div class="col-sm-4">
						<input id="userKey" name="userKey" class="form-control" type="text" disabled th:value="${sysUserGoogle.googleKey}" style="width: 80%;float: left">
<!--						<button type="button" class="btn btn-primary btn-rounded btn-sm" style="float:left;" onclick="resetUserKey()">重设</button>-->
					</div>
				</div>
			</div>
		</div>


	</form>
</div>

<th:block th:include="include :: footer" />
<script th:inline="javascript">
	var prefix = ctx + "system/user";
	var userRoles = [[${userRoles}]]


/*	/!* 修改apikey-提交 *!/
	function submitHandler(index, layero){
		// var rows = $.table.selectFirstColumns();
		var data = { "userId": $("#userId").val(), "userKey": $("#userKey").val(), "loginName": $("#loginName").val() };
		$.ajax({
			type: "POST",
			url: prefix + '/changeUserKey' ,
			data: data ,
			async: false,
			success: function (data) {
				$.modal.confirm("重设成功;是否退出此页面", function() {
					var index = parent.layer.getFrameIndex(window.name);
					$.modal.close(index);
				});
			},
			error: function () {
				$.modal.msgError("未知错误,请重试");
			}
		})
	}

	function resetUserKey() {
		var userId = $("#userId").val();
		$.ajax({
			type: "GET",
			url: prefix + '/changeUserKey/' + userId,
			async: false,
			success: function (data) {
				$("#userKey").val(data);
			},
			error: function () {
				$.modal.msgError("未知错误,请重试");
			}
		})
	}*/
</script>
</body>
</html>